package com.yuwei.main.demo

import com.alibaba.android.arouter.facade.annotation.Route
import com.blankj.utilcode.util.LogUtils
import com.yuwei.base.RoutePath
import com.yuwei.common.entity.CategoryEntity
import com.yuwei.common.mvi.BaseMviActivity
import com.yuwei.common.mvi.UiState
import com.yuwei.main.databinding.ActivityDemoBinding
@Route(path = RoutePath.DEMO_ACTIVITY)
class DemoActivity : BaseMviActivity<ActivityDemoBinding,DemoViewModel>() {
    override fun successData(it: UiState.onSuccess<*>) {
        when(it.type){
           "getGoodsCategory" -> {
               val data = it.data as CategoryEntity
               LogUtils.d("yuwei","data = ${data.size}")
           }
        }
    }

    override fun failureData(error: String) {

    }

    override fun initView() {
        vm.sendIntent(DemoIntent.getGoodsCategory)
    }

    override fun initData() {

    }

}